From f3fdbe735910281bb939ca8d650b02bcd160f15e Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 28 Jun 2010 16:49:45 +0100 Subject: [PATCH] tools/python: sxp parser: show empty string This patch makes the sxp parser show empty string. Test case: import sxp sxp.show(sxp.from_string('(a "")')) sxp.show(sxp.from_string("(a '')")) Without this patch: (a )(a ) With this patch: (a '')(a '') Signed-off-by: Zhigang Wang --- tools/python/xen/xend/sxp.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/python/xen/xend/sxp.py b/tools/python/xen/xend/sxp.py index c31f8e4d21..c87270f070 100644 --- a/tools/python/xen/xend/sxp.py +++ b/tools/python/xen/xend/sxp.py @@ -365,6 +365,8 @@ class Parser: def atomp(sxpr): """Check if an sxpr is an atom. """ + if sxpr == '': + return 0 if sxpr.isalnum() or sxpr == '@': return 1 for c in sxpr: -- 2.30.2